package Day20;

public class Demo07 {
    public static void main(String[] args) {
//        print(new MyMath() {
//            @Override
//            public int sum(int x, int y) {
//                return x + y;
//            }
//        },100,200);
        //简化
        print((int x, int y) ->{
            return x +y ;
        },100,200);
    }
    static interface MyMath{
        int sum(int x,int y);
    }

    public static void print(MyMath n,int x,int y){
        int num  = n.sum(x,y);
        System.out.println(num);
    }
}
